// 该文件用于暴露store对象, 整个应用只有一个对象

// 用于创建store对象, applyMiddleware执行中间件 combineReducers合并reducers
import { createStore, applyMiddleware, combineReducers } from 'redux'

// 引入汇总后的reducers
import allReducers from './reducers'

// 引入redux-thunk, 用于支持异步action
import thunk from 'redux-thunk'
// 引入redux-devtools-extension
import { composeWithDevTools } from 'redux-devtools-extension'

// 暴露store对象 applyMiddleware(thunk)支持异步action composeWithDevTools支持开发者工具
export default createStore(allReducers, composeWithDevTools(applyMiddleware(thunk)));
// export default createStore(allReducers, applyMiddleware(thunk));
